﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.IO;

namespace Rio.WCF.Services.helpers
{
    public static class FileInfoExtention
    {
        /// <summary>
        /// Extention of FileInfo[]
        /// </summary>
        /// <param name="files"></param>
        /// <returns></returns>
        public static List<string> ConvertToList(this FileInfo[] files)
        {
            List<string> list = new List<string>();
            for (int i = 0; i < files.Length; i++)
            {
                list.Add(files[i].Name);
            }
            return list;
        }

        /// <summary>
        /// Extention of FileInfo[]
        /// </summary>
        /// <param name="files"></param>
        /// <returns></returns>
        public static List<string> ConvertToListWithFullName(this FileInfo[] files)
        {
            List<string> list = new List<string>();
            for (int i = 0; i < files.Length; i++)
            {
                list.Add(files[i].FullName);
            }
            return list;
        }

    }
}